package master;

import java.util.ArrayList;
import java.util.List;

/**
 * 杨慧三角2
 *
 * @author chenyw
 * @date 2022/7/30 19:44
 */
public class M119getRow {
    public List<Integer> getRow(int rowIndex) {
        //组合公式
        List<Integer> list = new ArrayList<>();
        list.add(1);
        for (int i = 1; i <= rowIndex; i++) {
            //注意类型型转换
            list.add((int) ((long) list.get(i - 1) * (rowIndex - i + 1) / i));
        }
        return list;
    }
}
